package net.luohuasheng.bee.proxy.mybatis.common.enums;

/**
 * SqlBuilder like 枚举
 */
public enum SqlLike {
    /**
     * DEFAULT
     */
    DEFAULT("default", "两边%"),
    /**
     * LEFT
     */
    LEFT("left", "左边%"),
    /**
     * RIGHT
     */
    RIGHT("right", "右边%");

    /**
     * 主键
     */
    private final String type;

    /**
     * 描述
     */
    private final String desc;

    SqlLike(final String type, final String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static SqlLike getTypeByCode(String type) {
        for (SqlLike element : SqlLike.values()) {
            if (element.getType().equals(type)) {
                return element;
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

}
